//
//  ST_PairsCenterCornerSectionHeaderView.swift
//  btvideo
//
//  Created by mac on 2020/1/17.
//  Copyright © 2020 JarvanZhang. All rights reserved.
//

import UIKit
import SwifterSwift

class ST_PairsCenterCornerSectionHeaderView: UITableViewHeaderFooterView {
    
    override init(reuseIdentifier: String?) {
        super.init(reuseIdentifier: reuseIdentifier)
        
        self.contentView.backgroundColor = Color.init(hex: 0xACB4C0)
        self.addSubview(cornerView)
        cornerView.snp.makeConstraints { (make) in
            make.edges.equalToSuperview().inset(UIEdgeInsets.init(top: 3, left: 0, bottom: -2, right: 0))
        }
        
        self.addSubview(content_label)
        content_label.snp.makeConstraints { (make) in
            make.top.equalToSuperview().offset(27)
            make.left.equalToSuperview().offset(15)
        }
    }
    
    
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
//    MARK: - perperties
    
    fileprivate lazy var content_label:UILabel = {
        let control = UILabel.init()
//        control.backgroundColor = Color.random
        control.text = ""
        control.textColor = Color.init(hexString: "#333333")
        
//        control.textAlignment = .center
        control.font = UIFont.systemFont(ofSize: 16, weight: UIFont.Weight.semibold)
        return control
    }()
    
    
    var model = ST_PairsUserCenterSectionModel(){
        didSet{
            content_label.text = model.text
        }
    }
    
    fileprivate lazy var cornerView:UIView = {
        let control = UIView()
        control.backgroundColor = UIColor.white
        return control
    }()
    
    override func layoutSubviews() {
        super.layoutSubviews()
        
//        print("cornerView.roundCorners-----frame:",cornerView.frame)
        cornerView.roundCorners([UIRectCorner.topLeft,UIRectCorner.topRight], radius: 30)
        
    }

}
